<template>
  <div class="person">
    <navBar title="设置" @onClickLeft="onClickLeft" />
    <van-cell-group>
      <van-cell title="实名认证" value=">" @click="$router.push('/authentication')" />
      <van-cell
        title="修改资料"
        value=">"
        @click="$router.push('/edituserinfo')"
      />
      <van-cell
        title="修改手机号码"
        value=">"
        @click="$router.push('/edituserphone')"
      />
      <van-cell
        title="修改密码"
        value=">"
        @click="$router.push('/edituserpassword')"
      />
    </van-cell-group>
    <div class="btn_warp">
      <van-button type="info" class="btn" @click="logOut">退出账号</van-button>
    </div>
  </div>
</template>

<script>
import navBar from "@cb/navBar.vue";
import { Toast } from "vant";
export default {
  components: {
    navBar
  },
  data() {
    return {};
  },
  methods: {
    onClickLeft() {
      this.$router.back();
    },
    // 退出按钮
    logOut() {
      this.$store.commit("delUser");
      this.$store.commit("delToken");
      sessionStorage.removeItem("store");
      sessionStorage.removeItem("token");
      this.$message.success("退出成功");
      this.$router.replace("/");
    }
  },
  deactivated() {
    this.$destroy(true); //销毁组件
  }
};
</script>

<style lang="less" scoped>
.person {
  .btn_warp {
    margin-top: 10%;
    display: flex;
    justify-content: center;
    .btn {
      width: 325px;
      height: 45px;
      background: #0016ff;
      border-radius: 22.5px;
      position: fixed;
      bottom: 3%;
    }
  }
}
</style>
